using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class PMS_RuleTypeMap : EntityTypeConfiguration<PMS_RuleType>
	{
		public PMS_RuleTypeMap()
		{
			// Primary Key
			this.HasKey(t => t.RuleTypeId);

			// Properties
			this.Property(t => t.RuleTypeKey)
				.HasMaxLength(50);
				
			this.Property(t => t.RuleTypeName)
				.HasMaxLength(50);
				
			this.Property(t => t.SourceName)
				.HasMaxLength(200);
				
			this.Property(t => t.SubSysKey)
				.HasMaxLength(50);
				
			// Table & Column Mappings
			this.ToTable("PMS_RuleType");
			this.Property(t => t.RuleTypeId).HasColumnName("RuleTypeId");
			this.Property(t => t.RuleTypeKey).HasColumnName("RuleTypeKey");
			this.Property(t => t.RuleTypeName).HasColumnName("RuleTypeName");
			this.Property(t => t.SourceType).HasColumnName("SourceType");
			this.Property(t => t.SourceName).HasColumnName("SourceName");
			this.Property(t => t.SubSysKey).HasColumnName("SubSysKey");
			this.Property(t => t.IsDelete).HasColumnName("IsDelete");
			this.Property(t => t.CreateBy).HasColumnName("CreateBy");
			this.Property(t => t.CreateTime).HasColumnName("CreateTime");
			this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
			this.Property(t => t.UpdateTime).HasColumnName("UpdateTime");
		}
	}
}

